/*###########################################################
# © 2013-2016 Daniel 'grindhold' Brendle
#
# This file is part of Nostril.
#
# Nostril is free software: you can redistribute it and/or 
# modify it under the terms of the GNU Affero General Public License 
# as published by the Free Software Foundation, either 
# version 3 of the License, or (at your option) any later 
# version.
#
# Nostril is distributed in the hope that it will be 
# useful, but WITHOUT ANY WARRANTY; without even the implied 
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
# PURPOSE. See the GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public 
# License along with Nostril. 
# If not, see http://www.gnu.org/licenses/.
###########################################################*/

using Gtk;

namespace nostril {
    class Main : Gtk.Application {
        public Main() {
                GLib.Object(application_id: "de.grindhold.nostril",
                flags: ApplicationFlags.HANDLES_COMMAND_LINE,
                register_session: true);
                this.set_inactivity_timeout(500);
                var ms = new data.MessageStore(); 
                var p = new ProxyServer(ms);
                p.run_async();
                new gui.Gui(ms);
                Gtk.main();
        }

        public static int main(string[] argv){
            Gtk.init(ref argv);   
            new Main();
            return 0;
        }
#if DEBUG
        public const string DATAPATH = "data/";
#else
        public const string DATAPATH = "/usr/share/nostril/";
#endif
    }
}
